const babylon = require('babylon')
const traverse = require('babel-traverse').default
const generate = require('babel-generator').default

const code = "const abc = 5;";

const ast = babylon.parse(code);

// console.log(traverse.default);
traverse(ast, {
    enter(path) {
        if (path.node.type === 'Identifier') {
            path.node.name = path.node.name.split("").reverse().join("");
            console.log(path.node.name);
        }
        
    }
});

const newCode = generate(ast);

console.log(newCode);
